#Calstatic.py

def getNum():
    nums = []
    iStr = input("请输入数字(回车退出)：")
    while iStr != '':
        nums.append(eval(iStr))
        iStr = input("请输入数字(回车退出)：")
    return nums
  
def averageNum(nums):
    s = 0.0
    for num in nums:
        s += num
    return s/len(nums)

def dev(nums,average):
    sdev = 0.0
    for num in nums:
        sdev += (num-average)**2
    return pow(sdev/len(nums),0.5)

def median(nums):
    sorted(nums)
    size = len(nums)
    if size % 2 == 0:
        med = (nums[size//2-1] + nums[size//2])/2
    else:
        med = nums[size//2]
    return med

def calV1():
    num = getNum()
    ave = averageNum(num)
    print("平均值：{} 方差：{:.2} 中位数：{}.".format(ave,dev(num,ave),median(num)))
    return ave, num

ave, num = calV1()